package com.shaunstone.web.sports.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.shaunstone.web.sports.common.Roles;
import com.shaunstone.web.sports.dal.dao.repo.TeamRepository;
import com.shaunstone.web.sports.dal.model.PersonTeamMapping;
import com.shaunstone.web.sports.dal.model.Team;

@Controller
@Secured({ "ROLE_" + Roles.COACH_STRING })
public class CoachesController {

	// updateRoster()
	@RequestMapping("/{id}/coaches")
	public String getCoachesTeamPage(@PathVariable("id") Team team, Model model) {
		model.addAttribute("team", team);
		model.addAttribute(new PersonTeamMapping());
		return "coach";

	}

}
